{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# B 08 3 完全随机设计的方差分析 One Way ANOVA\n",
    "\n",
    "用于数值变量与多项无序分类变量之间的相关性分析。\n",
    "\n",
    "## 案例\n",
    "\n",
    "将 30 名志愿者随机分为 3 组，分别注射 0.5U, 1U 和 2U 的药物，48h 后观察部分凝血活酶时间 (s)。\n",
    "\n",
    "### 数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (30, 3)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>id</th><th>group</th><th>value</th></tr><tr><td>i64</td><td>str</td><td>f64</td></tr></thead><tbody><tr><td>1</td><td>&quot;0.5U&quot;</td><td>36.8</td></tr><tr><td>2</td><td>&quot;0.5U&quot;</td><td>34.4</td></tr><tr><td>3</td><td>&quot;0.5U&quot;</td><td>34.3</td></tr><tr><td>4</td><td>&quot;0.5U&quot;</td><td>35.7</td></tr><tr><td>5</td><td>&quot;0.5U&quot;</td><td>33.2</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>26</td><td>&quot;2U&quot;</td><td>37.6</td></tr><tr><td>27</td><td>&quot;2U&quot;</td><td>40.2</td></tr><tr><td>28</td><td>&quot;2U&quot;</td><td>38.1</td></tr><tr><td>29</td><td>&quot;2U&quot;</td><td>32.4</td></tr><tr><td>30</td><td>&quot;2U&quot;</td><td>35.6</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (30, 3)\n",
       "┌─────┬───────┬───────┐\n",
       "│ id  ┆ group ┆ value │\n",
       "│ --- ┆ ---   ┆ ---   │\n",
       "│ i64 ┆ str   ┆ f64   │\n",
       "╞═════╪═══════╪═══════╡\n",
       "│ 1   ┆ 0.5U  ┆ 36.8  │\n",
       "│ 2   ┆ 0.5U  ┆ 34.4  │\n",
       "│ 3   ┆ 0.5U  ┆ 34.3  │\n",
       "│ 4   ┆ 0.5U  ┆ 35.7  │\n",
       "│ 5   ┆ 0.5U  ┆ 33.2  │\n",
       "│ …   ┆ …     ┆ …     │\n",
       "│ 26  ┆ 2U    ┆ 37.6  │\n",
       "│ 27  ┆ 2U    ┆ 40.2  │\n",
       "│ 28  ┆ 2U    ┆ 38.1  │\n",
       "│ 29  ┆ 2U    ┆ 32.4  │\n",
       "│ 30  ┆ 2U    ┆ 35.6  │\n",
       "└─────┴───────┴───────┘"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import polars as pl\n",
    "\n",
    "df = pl.read_csv(\"B_08_3-data.csv\")\n",
    "\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjwAAAG5CAYAAACKmu5sAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA6AUlEQVR4nO3deXhU9aH/8c9kMpN9ISyBJOzBsCUQtoCISogKiERtaakVN1QUg9b+amtraWvtVa8ttwXkYkGgLm21Sl1KccGlWEVQUDFA0ISwL8OafZvMnN8fXlJjAoQw5Jw5eb+e5z7Pne/3nJnP+ETn0/P9zhmHYRiGAAAAbCzE7AAAAADnG4UHAADYHoUHAADYHoUHAADYHoUHAADYHoUHAADYHoUHAADYHoUHAADYXqjZAazg008/lWEYcrlcZkcBAAAt5PV65XA4lJmZecZjKTySDMMQN5wGACC4nM1nN4VHariyk56ebnISAADQUvn5+S0+lj08AADA9ig8AADA9ig8AADA9ig8AADA9ig8AADA9ig8AADA9ig8AADA9ig8A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Ll266OjRo5Ikt9utjh07Nvp9LY/Hw317AAA4ByGOEKUnDmh2bkjXgW2cJvi1atPyiBEjtG7dOt15552SpEmTJmnZsmVyOp3y+/166qmnNG7cuIAGBQCgvZmeMVU7T+xRWW1Fw1iXqI7K7X+5iamCU6sKz80336x169aprq5Obrdbc+bMUVFRkebPny9JGjlypH7+858HNCgAAO1NUkyiHrnsfv1790fyVBxR97gkje05UuGhYWZHCzoO4+T3yc9CUVFRwx6erysrK1NISIiio6MDEq6t5OfnS5LS09NNTgIAAFrqbD6/W3WFZ8qUKbrgggs0efJkTZo0ST179pQkxcbGtubpAAAAzqtWbVr+1a9+pQ4dOmjBggWaOHGirr32Wj355JPav39/oPMhCBXtK9GKf2zVH1/6XBsLPGrFRUQAAAKqVUtaJx09elSvv/66XnvtNX3yySeSpIyMDE2ePFkTJ05UYmJiwIKeTyxpBc7qdTv1p1XbGo1dNCRJd38306REAAC7OpvP73MqPF/n8Xj02muv6fXXX9fnn38uh8OhrVu3BuKpzzsKT2CUVtRq9mPvyFvvbzI395Yspad2MiEVAMCuzubzO2C/lt65c2f169dPffr0UXh4eJMfE4W9VdV4tfKdQlXX1je7hPXpl4ebPW/ngVK9s3GPtuw4ytIXAOC8OadfSzcMQxs2bNDq1av11ltv6cSJE4qNjdWVV16pyZMnByojLG5jgUcLnv9UVTX18tb75ZXkCg1RqPM/fToirPGfWr3Pr/nPf6oNWw41jPVOitXPbhqluGi+bgkACKxWFZ6NGzfqtdde0xtvvKFjx44pOjpaOTk5mjRpki688EKFhp5Tj0IQqaz2av7zn6q2zqeQEIccDskwJG+9X84QhxwOh5whDl2cmdLovNUf7GxUdiRp54Ey/WnVNt0znf0+AIDAalUzuf766xUZGanx48dr8uTJGjdunNxud6CzIQhsLPCots7X8NjtcqrO65NhSD6/obhot27LHazEhMhG572/+UCzz7dh60F56zPkCnWe19wAgPalVYVn/vz5uvTSSxUWxtJDe1fva7xXK8ThULg7VH6/oewRKZqZm64wV9Py8s3zTvL7DfnZyg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ni1evFgJCQkNj8eMGaOSkhKtWLFCs2fPVkgIiytm4J86Gnnvvfc0ZsyYhrIjSZMmTZLf79cHH3xgXjDgNPgAgZV8veycNGDAAFVUVKiqqsqERJAoPPiG4uJi9enTp9FYbGysOnfurOLi4jOe/49//EODBw9WZmambrvtNn3xxRfnKyoABI1NmzYpMTFR0dHRZkdpt1jSQiNlZWWKjY1tMh4XF6fS0tLTnpudna2MjAwlJSVp7969euKJJ3Tdddfp5ZdfVvfu3c9XZACwtI0bN2r16tX6yU9+YnaUdo0rPAiYn//855o6dapGjBiha665Rs8884wknfKbCABgd4cOHdK9996rrKws3XDDDWbHadcoPGgkNjZW5eXlTcZLS0sVFxd3Vs/VpUsXDR8+XFu3bm0Yczqd8vl8zR7v9/sVGspFR5wfp/vb8/l8/O0h4MrKynTbbbcpPj5eCxcubLTXjL/HtkfhQSN9+vRpslenvLxcR44cabK3pzUSEhJUW1ursrKyJnOHDx9udrMfEAgJCQk6evRok/GTG0k7duxoQirYVU1NjWbNmqXy8nI9+eSTiomJaTTP32Pbo/CgkYsvvljr1q1rVEhef/11hYSEaOzYsWf1XB6PR5s2bVJ6enrD2MiRIyVJ77zzTqNj6+vr9e677zbMA4E2cuRIrV27VvX19Y3G33rrLUnS8OHDzYgFG6qvr9cPfvADFRcX68knn2z2dh78PbY9rpmhkenTp+uZZ57RXXfdpVmzZsnj8eixxx7T9OnTG/1Le+ONN+rAgQNas2aNJGnVqlV69913dckll6hLly7au3evlixZIqfTqZtvvrnhvL59+2rKlCn61a9+pYMHD2rIkCEqKSnRX/7yFx08eFALFixo8/eM4FddXa21a9dKkvbv36+Kigq9/vrrkqRRo0YpISFBs2bN0ne+8x3ddNNNuu666xQfH6/NmzfriSee0FVXXaW+ffua+RZgIw8++KDeffdd3X///aqoqNBnn33WMDdw4EC53W7+Hk3gMLglKb5hx44deuihh/Tpp58qKipKubm5uvfeexvdMXnGjBnav39/w5Wazz77TPPmzVNhYaHKy8sVExOj0aNH6+67726yFOb1evXH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85P9P5Y8eO1dtvv93oa+VHjx7VqlWrNHz4cEVHR0uSevToIUn6+OOPG46rqqrSyy+/3OxzHz58WGvWrGl4XFFRoZdfflkDBgxQ586dz+p9AjAH39ICYBl5eXl6//339b3vfU/f+9735Pf79eyzz6pfv34qKCg44/k/+MEPtG7dOl133XW67rrr5HQ69fzzz6uurk733Xdfw3Fjx45VUlKSHnjgARUXF8vpdGrlypXq0KFDs1d5evXqpQceeED5+fnq2LGjVq5cqWPHjumRRx4J6PsHcP5whQeAZQwePFhLly5VXFyc5s+frxdffFF33323xowZo7CwsDOe369fP/35z39Wv3799Mc//lGLFi1SUlKSnn766Ub34HG5XHr88cfVo0cPzZ8/X88884ymTZum66+/vtnn7dWrl37/+99r7dq1mjdvnurr6/X73/++2W+PAbAmh/HNhWkAsJjZs2erqKjIlLsbZ2dnNxQoAMGLKzwALKWmpqbR4127dum9997TqFGjTEoEwA7YwwPAUnJycnTNNdeoe/fu2r9/v5577jm5XC7deuutZkcDEMQoPAAsZdy4cfrnP/+pI0eOyO12a+jQofrhD3/YcKM/AGgN9vAAAADbYw8PAACwPQoPAACwPQoPAACwPQoPAACwPQoPAACwPQoPAACwPQoPAACwPQoPAACwPQoPAACwvf8PZNebApt6jQQAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "\n",
    "sns.set_theme(\"notebook\")\n",
    "sns.set_style(\"whitegrid\")\n",
    "\n",
    "\"\"\"rel = sns.relplot(\n",
    "    data=df,\n",
    "    x=\"group\",\n",
    "    y=\"value\",\n",
    "    hue=\"group\",\n",
    "    aspect=1\n",
    ")\"\"\"\n",
    "\n",
    "x = df.select(\"group\").to_series()\n",
    "y = df.select(\"value\").to_series()\n",
    "\n",
    "strp = sns.stripplot(data=df, x=\"group\", y=\"value\", hue=\"group\", alpha=.95)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 分析\n",
    "\n",
    "结果变量为数值变量，影响变量为多项有序分类变量。可以采用完全随机设计的方差分析推断相关性。  \n",
    "也可以使用 Spearman 计算两个变量的秩相关的强度。\n",
    "\n",
    "### 假设检验\n",
    "\n",
    "#### 完全随机设计方差分析 OneWay Anova"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "F-statistic: 6.52\n",
      "p-value: 4.88e-03\n",
      "Significance: True\n"
     ]
    }
   ],
   "source": [
    "from scipy.stats import f_oneway\n",
    "\n",
    "res = f_oneway(\n",
    "    *map(\n",
    "        lambda x: df.filter(pl.col(\"group\") == x).select(\"value\"), \n",
    "        df.select(\"group\").unique().to_series().to_list()\n",
    "    )\n",
    ")\n",
    "\n",
    "print(f\"\"\"F-statistic: {float(res.statistic.sum()):.2f}\n",
    "p-value: {float(res.pvalue.sum()):.2e}\n",
    "Significance: {float(res.pvalue.sum()) < 0.05}\"\"\"\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$ P < 0.05 $, 拒绝原假设，认为不同组的部分凝血活酶时间的总体均数不全相同。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
